<?php 
	$host  = $_SERVER['HTTP_HOST'];
	if ($_SERVER['SERVER_NAME'] == 'localhost'){$uri="/kalender";}else{$uri="";}

	if (!is_object($bd)){	
		//me conecto a la base de datos
		require("../globals/Db.class.php");
		require("../globals/Conf.class.php");
		$bd=Db::getInstance();	
	}

	$username = $bd->san($_POST["usuario"]);
	$query = "SELECT usuario, id FROM usuarios WHERE usuario = '$username'";
	//echo($query);
	$result = $bd->eje($query);
	$num_rows = $bd->numRows($result);
	$string_to_return = "";
	if($num_rows > 0){
		$string_to_return = "msg:NOK";
	}else{
		$string_to_return = "msg:OK";
	}
	echo($string_to_return);
?>
